package cn.b0x0.users8001.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author SomUrim
 * @version 1.0
 * @Description 描述
 * @data 2021/2/9
 */
@RestController
@Slf4j
//配置自动刷新
@RefreshScope
public class ConfigController {

    @Value("${user.name}")
    String name;

    @GetMapping("/user/getname")
    public String getName(){
        log.info("当前name值为："+name);
        return "当前name值为："+name;
    }

}
